package com.baocaiqiche.dev.taoforandroid;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;


public class MainActivity extends AppCompatActivity implements View.OnClickListener{

    public Button listShowBtn , imgsShowBtn , showSelfBtn , showLocationBtn , showVideoBtn ;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        listShowBtn = (Button) findViewById(R.id.listShowBtn);
        imgsShowBtn = (Button) findViewById(R.id.imgsShowBtn);
        showSelfBtn = (Button) findViewById(R.id.showSelfBtn);
        showVideoBtn = (Button) findViewById(R.id.showVideoBtn);
        showLocationBtn = (Button) findViewById(R.id.showLocationBtn);

        listShowBtn.setOnClickListener(this);
        imgsShowBtn.setOnClickListener(this);
        showSelfBtn.setOnClickListener(this);
        showVideoBtn.setOnClickListener(this);
        showLocationBtn.setOnClickListener(this);

    }

    @Override
    public void onClick(View view) {
        switch (view.getId()){
            case R.id.listShowBtn :
                Intent lastIntent = new Intent(MainActivity.this,ListActivity.class);
                startActivity(lastIntent);
                break;
            case R.id.imgsShowBtn :
                Intent imgsIntent = new Intent(MainActivity.this,ImagesActivity.class);
                startActivity(imgsIntent);
                break;
            case R.id.showSelfBtn :
                Intent intent = new Intent(MainActivity.this,MainActivity.class);
                startActivity(intent);
                break;
            case R.id.showVideoBtn :
                Intent mediaIntent = new Intent(MainActivity.this,MultiMediaActivity.class);
                startActivity(mediaIntent);
                break;
            case R.id.showLocationBtn :
                Intent LocationIntent = new Intent(MainActivity.this,LocationActivity.class);
                startActivity(LocationIntent);
                break;
            default:
                break;
        }
    }
}
